package org.pupil.router;

import org.pupil.common.constants.LoadBalance;
import org.pupil.spi.ExtensionLoader;

import java.io.IOException;


/**
 * @Description: 负载均衡工厂
 * @Author: pupil
 * @Date: 2024/07/16 下午 3:29
 */
public class LoadBalancerFactory {

    public static LoadBalancer get(LoadBalance loadBalance){
        return ExtensionLoader.getInstance().get(loadBalance.name);
    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(LoadBalancer.class);
    }
}
